<?php

require 'firebaseLib.php';
require 'firebase.php';
require 'mineFunctions.php';

// Confirm user exists
$id = $_POST['id'];
if (!doesUserExist($id)) die();

// Authenticate token
$token = $_POST['token'];
if (! authorizeToken($token, $id)) die();

mine();